package cn.aws360.boot.system.api.pojo.request;

import cn.aws360.boot.base.api.validation.ValidationGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author junnan
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("系统部门-写入实例")
public class SysDeptWrite {

    @ApiModelProperty(value = "部门 id, 修改时为必传")
    @NotNull(message = "部门 id 不能为空", groups = {ValidationGroup.edit.class})
    private Integer id;

    @ApiModelProperty(value = "上级部门 pid", required = true)
    @NotNull(message = "上级部门 pid 不能为空", groups = {ValidationGroup.add.class, ValidationGroup.edit.class})
    private Integer pid;

    @ApiModelProperty(value = "部门名称", required = true)
    @NotBlank(message = "部门名称 name 不能为空", groups = {ValidationGroup.add.class, ValidationGroup.edit.class})
    private String name;

    @ApiModelProperty(value = "部门排序", required = true)
    @NotNull(message = "部门排序 sort 不能为空", groups = {ValidationGroup.add.class, ValidationGroup.edit.class})
    private Integer sort;

}
